package com.cloudptt.api.product.operator;

import com.cloudptt.api.product.func.SipOperator;
import com.cloudptt.api.product.func.addr.IAddrDefaultOp;
import com.mcptt.config.DbOperatorManager;
import com.mcptt.config.local.SysConfig;
import com.mcptt.config.model.McIdInfo;
import com.mcptt.http.operator.IHttpAddrOpCb;
import com.mcptt.http.operator.addr.AddressLoader;
import com.mcptt.http.operator.online.OnlineLoader;

import android.content.Context;

public class AddrPriOperator extends SipOperator
{
//	private final static String THIS_FILE = "AddrOperator";
	//	private GroupInfo curGroupInfo = null;
	private DbOperatorManager dbOperator = null;
	private IAddrDefaultOp defaultOp = null;
	private McIdInfo mcId = null;

	public AddrPriOperator(Context ctx,DbOperatorManager dbOperator,IAddrDefaultOp defaultOp,McIdInfo mcId)
	{
		super(ctx);
		this.dbOperator = dbOperator;
		this.defaultOp = defaultOp;
		this.mcId = mcId;
	}

	public void loadAddress(SysConfig config,IHttpAddrOpCb callback)
	{
		AddressLoader loader = new AddressLoader(config,dbOperator.getAddrDbOperator(),callback);
		loader.doGetAddr();
	}
	
	public void loadOnlineState(final String svrIp,final IHttpAddrOpCb callback)
	{
		OnlineLoader loader = new OnlineLoader(svrIp,dbOperator.getMapDbOperator(),callback);
		loader.load();
	}

}
